﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EIS_desktop
{
    public partial class Employee: Form
    {
        public Employee()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
        }

        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
           
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            System.Data.SqlClient.SqlConnection sqlcon = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings["constr"]);
            System.Data.SqlClient.SqlCommand sqlcmd = new System.Data.SqlClient.SqlCommand("insert Employee values ('" + txtFirstName.Text + "','" + txtSecondName.Text + "')", sqlcon);
            sqlcmd.CommandType = CommandType.Text;
            sqlcon.Open();
            int success = sqlcmd.ExecuteNonQuery();
            sqlcon.Close();
            if (success > 0)
                MessageBox.Show("Saved Successfully");
        }

       

       
    }
}
